package com.itheima.thread4;

public class Demo01 {

    public static void main(String[] args) {

        new Thread(()->{
            for (int i = 0; i < 100; i++) {
                Thread thread = Thread.currentThread();
                String name = thread.getName();
                System.out.println(name+"@@@"+i);
            }
        }).start();
        new Thread(()->{
            for (int i = 0; i < 100; i++) {
                Thread thread = Thread.currentThread();
                String name = thread.getName();
                try {
                    Thread.sleep(10);//单位 毫秒
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                System.out.println(name+"@@@"+i);
            }
        }).start();

    }
}
